package me.wz.util.sdbc;

public class Pagination {
    private int total = 0;
    private int pageNum = 0;
    private int pageSize = 10;
    private int pageTotal = 0;
    private String orderBy = null;

    public int getTotal() {
        return total;
    }

    public Pagination setTotal(int total) {
        this.total = total;
        return this;
    }

    public int getPageNum() {
        return pageNum;
    }

    public Pagination setPageNum(int pageNum) {
        this.pageNum = pageNum;
        return this;
    }

    public int getPageSize() {
        return pageSize;
    }

    public Pagination setPageSize(int pageSize) {
        this.pageSize = pageSize;
        return this;
    }

    public int getPageTotal() {
        return pageTotal;
    }

    public Pagination setPageTotal(int pageTotal) {
        this.pageTotal = pageTotal;
        return this;
    }

    public String getOrderBy() {
        return orderBy;
    }

    public Pagination setOrderBy(String orderBy) {
        this.orderBy = orderBy;
        return this;
    }

    public boolean getHasMoreMode(){ return getPageTotal() < 0; }
    public Pagination setHasMoreMode(boolean hasMoreMode){
        setPageTotal(hasMoreMode ? -1 : 0);
        return this;
    }
}
